// 引入节流函数
import throttle from "@/utils/throttle";

//设置稿为750px;
function setRem() {
  // 获取页面视口宽度
  let html = document.documentElement;
  let htmlWidth =
    document.documentElement.clientWidth || document.body.clientWidth;
  // 设置根元素字体大小
  html.style.fontSize = (htmlWidth / 375) * 100 + "px";
  console.log(html);
  console.log(htmlWidth);
  console.log((htmlWidth / 375) * 100 + "px");
}

window.addEventListener("DOMContentLoaded", function () {
  setRem();
});

window.onresize = throttle(setRem, 100);
